//
//  SelectAddressCell.m
//  WatermarkCamera
//
//  Created by zhibao on 2023/9/14.
//

#import "SelectAddressCell.h"
@interface SelectAddressCell(){
    UILabel *titleLabel;
    UILabel *detailLabel;
}
@end
@implementation SelectAddressCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        titleLabel = [UILabel new];
        titleLabel.text = @"旭辉空港中心";
        titleLabel.font = MY_SCALE_RegularFONT(13);
        titleLabel.textColor = MYBlock;
        [self.contentView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(37);
            make.right.mas_equalTo(-37);
            make.top.mas_equalTo(10);
        }];
        
        detailLabel = [UILabel new];
        detailLabel.text = @"100米 | 金关北街3号院";
        detailLabel.font = MY_SCALE_RegularFONT(11);
        detailLabel.textColor = MyColor(@"999999");
        [self.contentView addSubview:detailLabel];
        [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(37);
            make.right.mas_equalTo(-37);
            make.top.equalTo(titleLabel.mas_bottom).offset(3);
        }];
        
        UIView *line = [UIView new];
        line.backgroundColor = MyColor(@"#DEDEE0");
        [self.contentView addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.right.mas_equalTo(-15);
            make.height.mas_equalTo(0.5);
            make.bottom.equalTo(self.contentView);
        }];
    }
    return self;
}

-(void)update:(AMapPOI *)poi{
    titleLabel.text = poi.name;
    detailLabel.text = poi.address;
}
@end
